// FloatingTextManager class
// This class manages floating text that pops up
// in the middle of the game (text rendered in 
// world coordinates
#pragma once

#include "d3dUtil.h"

#define TEXTMANAGER	FloatingTextManager::Instance()

struct TextData
{
	char		*text;
	float		maxLifeTime;
	float		lifeTime;
	float		minScale;
	float		maxScale;
	float		scale;
	D3DXVECTOR3 position;
	ID3DXFont	*font;
	D3DCOLOR	color;
};

class FloatingTextManager
{
private:
	// private constructors
	FloatingTextManager(void);
	FloatingTextManager(const FloatingTextManager&);
	FloatingTextManager* operator=(const FloatingTextManager&);
	~FloatingTextManager(void);

protected:
	// storage of mesh and buffer information
	typedef std::vector<TextData*> Texts;
	Texts textData;

	ID3DXSprite *mSprite;

public:
	// initialize the text manager by giving
	// it a sprite to draw with
	void Initialize(ID3DXSprite *sprite);

	// updates all text objects
	void Update(float dt);

	// renders all text objects to the screen
	void Render();

	// adds a new text object to the list
	void AddFloatingText(ID3DXFont *font, char* text, float lifeTime, D3DXVECTOR3 position, float minScale, float maxScale, D3DCOLOR color);
	void AddFloatingText(ID3DXFont *font, int num, float lifeTime, D3DXVECTOR3 position, float minScale, float maxScale, D3DCOLOR color);
	void AddFloatingText(ID3DXFont *font, float num, float lifeTime, D3DXVECTOR3 position, float minScale, float maxScale, D3DCOLOR color);
	// accessing the singleton
	static FloatingTextManager* Instance();

	// adds a new text object to draw
};